package nanguo.not.cloud.service.impl;

import nanguo.not.cloud.dao.RoleRespority;
import nanguo.not.cloud.entity.Role;
import nanguo.not.cloud.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @Author: jing
 * @Date: 2019/3/26 20:04
 * @Version 1.0
 */
@Service
@Transactional(rollbackOn = Exception.class)
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleRespority respority;

    @Override
    public void save(Role t) {
        respority.save(t);
    }

    @Override
    public List<Role> findAll() {
        return respority.findAll();
    }

    @Override
    public void delete(Long id) {
        respority.deleteById(id);
    }
}
